package com.cn.ycy.aop.annation;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AopCustomAspectRound {
  Logger logger = LoggerFactory.getLogger(AopCustomAspectRound.class);

  @Pointcut("execution(public * com.cn.ycy.aop.annation.ServiceImpl.playround(..))")
  public void play() {
  }

  @Around(value = "play()")
  public void playAround(ProceedingJoinPoint joinPoint) {
    logger.warn("@around 带口罩");
    try {
      Object result = joinPoint.proceed();
    } catch (Throwable throwable) {
      throwable.printStackTrace();
    }
    logger.warn("@around 洗手");

  }

}
